<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Created by PhpStorm.
 * User: jinzhao
 * Date: 16-8-4
 * Time: 下午3:18
 */
class Admin_model extends CI_Model{
    public function change($email, $old, $new)
    {
        $ret =  $this->db->where(array('email' => $email, 'password' => $old))->update('user', array('password' => $new));
//        $ret = $this->db->update('user', array('password' => $new), array('email' => $email, 'password' => $old));
        if (!$ret){
            return false;
        }
        return $this->db->affected_rows() > 0 ? true : false;
    }
}
